using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class admin_logout : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        LogoutFrom();
    }
    private void LogoutFrom()
    {
        FormsAuthentication.SignOut();
        Session["AccountAdmin"] = "";
        Session["Username"] = "";
        Session.Abandon();
        Response.Cookies.Remove("UserName");
        Response.Cookies.Remove("PassWord");
        Response.Cookies["UserName"].Expires = DateTime.Now.AddMonths(-1);
        Response.Cookies["PassWord"].Expires = DateTime.Now.AddMonths(-1);
        Session["AccountAdmin"] = "False";
        Session["Username"] = "";
        Response.Redirect("Dangnhap.aspx");
    }

}
